package com.bosssoft.ecds.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.bosssoft.ecds.entity.po.UbeStockFinanceapplyItemPO;
import com.bosssoft.ecds.entity.po.UbeStockFinanceapplyPO;
import org.apache.ibatis.annotations.Select;

import java.math.BigInteger;
import java.util.List;

public interface UbeStockFinanceapplyMapper extends BaseMapper<UbeStockFinanceapplyPO> {
    @Select("SELECT " +
            "uai.* " +
            "FROM " +
            "ube_stock_financeapply_item AS uai " +
            "INNER JOIN ube_stock_financeapply AS ua " +
            "ON ua.f_id = uai.f_pid " +
            "WHERE " +
            "ua.f_id = #{id}")
    List<UbeStockFinanceapplyItemPO> getItems(BigInteger id);

    @Select("select f_no from ube_stock_financeapply ORDER BY -f_no LIMIT 1")
    BigInteger getMaxNo();

}
